<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="distinctiveList.title"/></title>
    <meta name="heading" content="<fmt:message key='distinctiveList.heading'/>"/>
    <meta name="menu" content="RoleMaterial"/>
    <script type="text/javascript">
        window.onload = function() {
            init();
            Effect.SlideDown('divNewDistinctiveForm');
            Effect.SlideDown('divDeleteDistinctiveForm');
        };
    </script>
</head>
<div id="help">
    <h2>
        <a href="<c:url value='helpDistintiveList.html?decorate=false'/>"
           title="Ayuda Listado Distintivos"
           onclick="Modalbox.show(this.href, {title: this.title, width: 600}); return false;">
            <fmt:message key="help"/>
        </a>
    </h2>
</div>
<c:set var="buttons">
    <input type="button" style="margin-right: 5px"
           onclick="Effect.SlideUp('divDeleteDistinctiveForm'); Effect.SlideDown('divNewDistinctiveForm'); return false;"
           value="<fmt:message key="button.add"/>"/>
<input type="button" style="margin-right: 5px"
           onclick="Effect.SlideUp('divNewDistinctiveForm'); Effect.SlideDown('divDeleteDistinctiveForm'); return false;"
F           value="<fmt:message key="button.delete"/>"/>

    <input type="button" onclick="location.href='<c:url value="/mainMenu.html"/>'"
           value="<fmt:message key="button.done"/>"/>

</c:set>

<c:out value="${buttons}" escapeXml="false" />

<s:set name="distinctives" value="distinctives" scope="request"/>
<br><br>
<display:table style="width:400px" name="dNames" class="table" requestURI="" id="distinctiveList" export="true" pagesize="25">
    <display:column sortable="true"
                    paramId="id" paramProperty="id" />
    <display:column property="name" sortable="true" titleKey="distinctive.name" />
    <display:column property="disValues" sortable="true" titleKey="distinctive.values"/>

    <display:setProperty name="paging.banner.item_name" value="distinctive"/>
    <display:setProperty name="paging.banner.items_name" value="distinctives"/>

    <display:setProperty name="export.excel.filename" value="Distinctive List.xls"/>
    <display:setProperty name="export.csv.filename" value="Distinctive List.csv"/>
    <display:setProperty name="export.pdf.filename" value="Distinctive List.pdf"/>
    <display:setProperty name="paging.banner.all_items_found" value=""/>
    <display:setProperty name="paging.banner.some_items_found" value=""/>

</display:table>
<div id="divNewDistinctiveForm" style="border-width:thin; border-color:gray; position:absolute; top:70px; left:670px; display: none;">
    <h1><fmt:message key="distinctive.new" /></h1>
    <s:form id="distinctiveForm" action="saveDistinctive" method="post" validate="true">
        <s:hidden name="distinctive.id" value="%{distinctive.id}"/>
        <s:textfield key="distinctive.name" cssClass="text medium" maxLength="40"/>
        <s:textfield key="distinctive.value" required="true" cssClass="text medium" maxLength="40"/>
        <li class="buttonBar bottom">
            <s:submit cssClass="button" method="save" key="button.save" theme="simple"/>
            <s:submit cssClass="button" method="cancel" key="button.cancel" theme="simple"/>
        </li>

    </s:form>
</div>

<div id="divDeleteDistinctiveForm" style="border-width:thin; border-color:gray; position:absolute; top:70px; left:670px; display: none;">
    <h1><fmt:message key="distinctive.delete" /></h1>

    <s:form id="deletedistinctiveForm" action="deleteDValue" method="get" validate="true">

        <s:doubleselect
            label="distinctive.name"
            name="distinctiveName"          doubleName="distinctiveValue"
            list="distinctiveNames"         doubleList="distinctiveValues"
            listKey="name"                    doubleListKey="name"
            listValue="name"                doubleListValue="name"/>
        <s:submit cssClass="button" method="deleteDistinctiveValue" key="button.delete" onclick="return confirmDelete('distinctive')" theme="simple"/>
        <s:submit cssClass="button" method="cancel" key="button.cancel" theme="simple"/>
        
    </s:form>
</div>

<c:out value="${buttons}" escapeXml="false" />

<script type="text/javascript">
    highlightTableRows("distinctiveList");
</script>